<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <form @submit.prevent="handleSubmit">
            <h2>使用修饰符时</h2>
            <button type="submit">提交</button>
        </form>
    </div>
    <script type="text/javaScript"  charset="UTF-8" src="../JS文件/vue.js"></script>
    <script type="text/javaScript">
        let vm  = new Vue({

            el:'#app',
            data(){
                return {
                    counter:0
                }
            },

            methods:{
                handleSubmit(){
                    console.log(`submit ${++this.counter} times`)
                }
            }

        })
    </script>
</body>
</html>